#ifndef __BLACKPLAYER_H__
#define __BLACKPLAYER_H__

#include "../checkerBoard/CheckerBoard.hpp"
#include "../chess/BlackChess.hpp"
#include "Player.hpp"
#include <iostream>
#include <ostream>
#include <string>

/**
 * @brief 黑色棋子玩家
 *
 */
class BlackPlayer : public Player {
public:
  BlackPlayer(std::string &name) : Player(name) {}
  virtual ~BlackPlayer() {}
  bool playGames(unsigned int x, unsigned int y) override {
    Chess *chess = new BlackChess(x, y);

    if (chess == nullptr) {
      return false;
    }
    CheckerBoard *checkerBoard = CheckerBoard::getCheckerBoard();
    if (checkerBoard->checkerBoardIsValidPosition(chess) == false) {
      return false;
    }
    checkerBoard->setChessset(chess);
    checkerBoard = nullptr;
    return true;
  }
};

#endif // __BLACKPLAYER_H__